package com.longteng.lesson2.dao.impl;

import com.longteng.lesson2.dao.IUserDao;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.Map;

/**
 * Created by li
 * DATE : 2018/11/25 0025
 * TIME : 22:58
 * PROJECT : java-lesson
 * PACKAGE : com.longteng.lesson
 *
 * @author <a href="mailto:55324936@qq.com">li</a>
 */
@Repository("userDao")
public class UserDao implements IUserDao {
    @Override
    public void addUserName(String userName) {
        //这个方法的逻辑不能修改，有其他的地方使用
        System.out.println(userName);
    }
    @PostConstruct
    public void initUser(){
        System.out.println("构造方式之后执行，初始化");
    }
    @PreDestroy
    public void destory(){
        System.out.println("销毁之前执行");
    }

    @Override
    public Map<String, String> getUserByName(String userName) {
        return null;
    }
}
